package ru.acme.lab09.domain.account;


abstract public class AbstractAccount implements Account {
	
	private int balance;
	
	public int getBalance() {
		return balance;
	}
	
	public void deposit(int amount) {
		balance += amount;
	}
	
	public boolean withdraw(int amount) {
		if (balance >= amount) {
			balance -= amount;
			return true;
		}
		return false;
	}
	
	public AbstractAccount(int balance) {
		this.balance = balance;
	}

	public int maximumAmountToWithdraw() {
		return balance;
	}
	
}
